var jwt = require('jsonwebtoken');
// https://github.com/auth0/node-jsonwebtoken

var secret = "codefinger";

sign = function(obj, callback) {
    jwt.sign(obj, secret, { algorithm: 'HS256', expiresIn: '3d'}, callback);
}

verify = function(signed, callback) {
    jwt.verify(signed, secret, callback)
}

module.exports = {
    sign,
    verify
}
